package com.itheima.service;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Bytezero_zhengLei
 * @Date: 2024/6/24 15:20
 * @Project_Name:
 * @Email: 420498246@qq.com
 * @Description:
 * @TODO:
 */

@Service
//操作层
//@Primary
public class UserServiceB implements UserServiceImp {

    @Autowired
    UserDao Dao;

    public List<User> getUserServiceList() {
        List<User> userDataList = Dao.getUserDataList();
        // 2. 遍历集合,获取所有的user对象, 对省份和城市操作
        for (User user : userDataList) {
            user.getAddress().setProvince(user.getAddress().getProvince() + " 省/市B");
            user.getAddress().setCity(user.getAddress().getCity() + " 区/县B");

        }
        return userDataList;
    }
}
